#include <iostream>
#include <cstring>
#include <unordered_map>
#include <queue>
#include <vector>
#include <cmath>
#define INF 1 << 30
using namespace std;
int N, D;
constexpr int MAXN = 10000 + 5;
typedef pair<double, double> range;

struct cmp {
    bool operator()(const range & r1, const range & r2) {
        if (r1.first < r2.first) return false;
        return true;
    }
};
priority_queue<range, vector<range>, cmp> q;

range calarea(int x, int y) {
    double dx = sqrt(D * D - y * y);
    auto area = make_pair(x - dx, x + dx);
    return area;
}

int solve();

int main() {
    freopen("in.txt","r",stdin);
    freopen("output.txt","w",stdout);
    int i = 0;
    while (cin >> N >> D && N + D != 0) {
        int x, y;
        bool flag = false;
        for (int i = 0; i < N; i++) {
            cin >> x >> y;
            if (y > D) flag = true;
            range m = calarea(x, y);
            q.push(m);
        }
        if (flag) cout << "Case " << ++i << ": " << -1 << endl; 
        else cout << "Case " << ++i << ": " << solve() << endl;
        while (!q.empty()) q.pop();
    }
}



int solve() {
    if (D < 0) return -1;
    int res = 0;
    double s = -INF, e = -INF;
    while (!q.empty()) {
        range x = q.top(); q.pop();
        if (x.first <= e) {
            e = min(e, x.second);
            continue;
        }
        e = x.second;
        res++;
    }
    return res;
}